<?php

use Facebook\FacebookSession;
use Facebook\FacebookRedirectLoginHelper as FHelper;
use Facebook\FacebookRequest;
use Facebook\GraphUser;

class IndexController extends ControllerBase
{

    public function indexAction()
    {
   

   		if($this->session->get('user_id') != null)
   		{
        $info = UserAccountTb::findFirstById($this->session->get('user_id'));
        if($info == true)
        {
            if($info->activated == 0)
            {
              header("Location: ".BASE_URI.'registration/confirm?ea='.$info->email);
            }
            else
            {
              header('Location:'.BASE_URI.'profile?bhd='.$this->session->get('user_id'));       
            }
        } 			
   		}

      $this->view->setVar('page_name', 'Index');
    	$this->view->setVar('content','index/index');
    }

}

